package adv6;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class ObjTest {

	public static void main(String[] args) {
		Student2 s = new Student2("老吴", "11113", 23, Sex.妖);
		try {
			ObjectOutputStream oout = new ObjectOutputStream(
					new FileOutputStream("stu.obj"));
			oout.writeObject(s);
			oout.close();
		} catch (IOException e) {
			// TODO 自动生成的 catch 块
			e.printStackTrace();
		}

	}

}
